package com.up360.rapidcalc.aerolite.model
{
    /**
     * @author Tunie
     * @date   May 2, 2013
     * 题目
     */
    public class Subject
    {
        /**
         *题干 
         */
        public var topic:String;
        /**
         *答案列表
         */
        public var answers:Array;
        
        public function Subject()
        {
        }
        
        public function toString():String
        {
            return "[Subject topic:"+topic+"]";
        }
        
        public function rightAnswer():String
        {
            for each(var obj:Object in answers)
            {
                var b_answer:Answer=obj as Answer;
                if(b_answer.isRight())
                {
                    return b_answer.content;
                }
            }
            return null;
        }
        
        /**
         *返回完整题目 
         * @return 
         */
        public function getSubject():String
        {
            return topic+"="+rightAnswer();
        }
            
    }
}